<template>
    <div class="container">
        <div style="height: 10px;"></div>
        <div class="info">
            <!-- 布局 -->
            <div style="height: 10px;"></div>
            <div style="padding: 10px;width: 90%;margin-left: 5%;" @click="passChange">
                <div style="display: flex;align-items: center;justify-content: space-between;">
                    <div class="flex-image" style="display: flex;align-items: center;">
                            <!-- <image src="http://175.24.179.10:20001/profile/farm_photo/2024/06/14/key_20240614152400A013.png"  mode="scaleToFill"/> -->
                            <image src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202408.png" />
                        <div style="width: 15px;"></div>
                        <div>密码修改</div>
                    </div>
                    <div style="display: flex;align-items: center;">
                        <u-icon color="#000000" name="arrow-right"></u-icon>
                        <div style="width: 10px;"></div>
                    </div>
                </div>
            </div>
            <div style="height: 30px;"></div>
            <div style="padding: 10px;width: 90%;margin-left: 5%;" @click="personinfo">
                <div style="display: flex;align-items: center;justify-content: space-between;">
                    <div class="flex-image" style="display: flex;align-items: center;">
                            <!-- <image src="http://175.24.179.10:20001/profile/farm_photo/2024/06/14/person_20240614152541A020.png"  mode="scaleToFill"/> -->
                             <image src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202410.png" />
                        <div style="width: 15px;"></div>
                        <div>个人姓名</div>
                    </div>
                    <div style="display: flex;align-items: center;">
                        <u-icon color="#000000" name="arrow-right"></u-icon>
                        <div style="width: 10px;"></div>
                    </div>
                </div>
            </div>
            <div style="height: 30px;"></div>
            <div style="padding: 10px;width: 90%;margin-left: 5%;" @click="logout">
                <div style="display: flex;align-items: center;justify-content: space-between;">
                    <div class="flex-image" style="display: flex;align-items: center;">
                            <!-- <image :src="base+'/profile/farm_photo/2024/06/14/logout_20240614152431A015.png'"  mode="scaleToFill"/> -->
                             <image src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202407.png" />
                        <div style="width: 15px;"></div>
                        <div>退出登录</div>
                    </div>
                    <div style="display: flex;align-items: center;">
                        <u-icon color="#000000" name="arrow-right"></u-icon>
                        <div style="width: 10px;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { logOut } from '../../common/example';
export default {
    data() {
        return {
            base:''
        }
    },
    methods: {
        // 退出登录
        logout(){
            uni.showModal({
                title: '提示',
                content: '确定要退出登录吗',
                showCancel: true,
                success: ({ confirm, cancel }) => {
                    if(confirm){
                    logOut().then(res=>{
                console.log(res.data);
                if(res.data.code==200){
                    setTimeout(()=>{
                        uni.clearStorageSync();
                        uni.reLaunch({
                            url:'/pages/index/index'
                        })
                        
                    },1000)
                }
            }) 
                    }else{
                        uni.showToast({
                            title: '取消退出',
                            icon: 'none',
                            mask: true
                        })
                    }
                }
            })
        },
        // 跳转个人信息
        personinfo(){
            uni.navigateTo({ url: '/pagesDriver/system/information' })
        },
        // 跳转密码修改
        passChange(){
            uni.navigateTo({ url: '/pagesDriver/system/changePass' })
        },
    },
    onLoad(){
        // uni.hideHomeButton();
    }
    
}
</script>
<style lang="scss">
.container{
    height: 100vh;
    width: 100vw;
    background: #ffffff;
    color: #000000;
}
.info{
    // background: #CCE1C8;
    // border-radius: 20px;
    // width: 90%;
    // margin-left: 5%;
    // height: 80vh;
}
.head-img image{
    width: 100rpx;
    height: 100rpx;
    border-radius: 50%;
}
.flex-image image{
    width: 75rpx;
	height: 75rpx;
}
.line-white{
    height: 4rpx;
    width: 90vw;
    background: #fff;
}
</style>